import { IsIn, IsOptional, IsString, MinLength } from "class-validator";
import User from "src/utils/interfaces/user.interface";
import { ApiProperty } from "@nestjs/swagger";

export class CreateUserDto {
  @IsString()
  @ApiProperty({
    description: "用户名",
  })
  @MinLength(2)
  username: string;

  @IsString()
  @MinLength(6)
  @ApiProperty({
    description: "密码",
  })
  password: string;

  @IsOptional()
  @IsIn(["manager"])
  @ApiProperty({
    required: false,
    description: "角色",
  })
  role?: User.Role;
}
